<template>
    <div class="PopupEnable">
        <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="visible" title=""
            :show-close="false" align-center class="dialogAdd">
            <div class="dialog_content">
                <div class="dialog_header">
                    <div class="title">
                        <img src="@/assets/images/rectangle07.png" alt="">
                        <span v-if="type_dialog=='Enable'">定期工作启用确认</span>
                        <span v-else="type_dialog=='Disable'">定期工作停用确认</span>
                    </div>
                </div>
                <div class="dialog_details">
                    <div class="details">
                        <div v-if="type_dialog=='Enable'">是否启用将所选定期工作任务？</div>
                        <div v-else="type_dialog=='Disable'">是否停用将所选定期工作任务？</div>
                        <div class="btn">
                            <el-button type="warning" @click="handleClose">确 认</el-button>
                            <el-button  @click="handleClose">取 消</el-button>
                        </div>
                    </div>

                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script setup lang="ts">
const props = defineProps({
    dialogVisible: {
        type: Boolean,
        default: false
    },
    type_dialog:{
        type: String,
        default: ''
    },
})

let visible = ref(false);

watch(() => props.dialogVisible, async (newValue, oldValue) => {
    visible.value = newValue;
    
});

//emit(父组件中的自定义方法)
const emit = defineEmits(['closeDialog']);

const handleClose = () => {
    emit("closeDialog");
}
</script>

<style scoped lang="scss">
.PopupEnable {
    :deep(.dialogAdd) {
        width: 400px;
        // width: 640px;
        min-height: 240px;
        background: rgba(255, 255, 255, 1);
        border-radius: 2px;
        box-shadow: 0px 6px 16px -8px rgba(0, 0, 0, 0.08), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 12px 48px 16px rgba(0, 0, 0, 0.03);

        .el-dialog__header {
            padding: 0;

        }

        .el-dialog__body {
            padding: 0;

            .dialog_content {
                .dialog_header {
                    padding: 0;
                    height: 59px;
                    padding: 8px 32px 4px 62px;
                    line-height: 52px;
                    font-size: 16px;
                    font-weight: 400;
                    color: rgba(0, 0, 0, 1);
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    border-bottom: 1px dashed rgba(112, 105, 95, 1);

                    .title {
                        display: flex;
                        align-items: center;

                        img {
                            width: 4px;
                            height: 22px;
                            margin-right: 15px;
                        }

                    }

                    .close {
                        width: 25px;
                        height: 25px;
                        cursor: pointer;

                    }
                }

                .dialog_details {
                    padding: 25px 45px 50px 48px;
                    font-size: 16px;
                    font-weight: 400;
                    letter-spacing: 0px;
                    line-height: 30px;
                    color: rgba(0, 0, 0, 1);

                    .details {
                        text-align: center;

                        .code_box {
                            // width: 293px;
                            // height: 188px;
                            width: 496px;
                            height: 318px;
                            background: url('@/assets//images/qr.jpg') no-repeat;
                            background-size: 100% 100%;
                            margin: 0 auto;
                            position: relative;

                            .text {
                                position: absolute;
                                font-size: 12px;
                                color: #fff;
                                z-index: 1;
                                bottom: 72px;
                                left: 39px;
                                text-align: left;
                                width: 165px;
                                line-height: 12px;

                                .spaceName {
                                    font-size: 16px;
                                    line-height: 16px;
                                }

                                .num_location {
                                    width: 196px;
                                    font-size: 12px;
                                    transform: scale(0.83);
                                    transform-origin: left;
                                    line-height: 16px;
                                    margin: 12px 0 5px 0;

                                    .location {
                                        display: flex;
                                        margin-bottom: 10px;

                                        .location_label {
                                            display: inline-block;
                                            width: 60px;
                                            flex-basis: 60px;
                                            flex-shrink: 0;

                                        }

                                        .location_text {
                                            display: inline-block;
                                            flex: 1;
                                            min-width: 0;
                                            width: auto;
                                            flex-wrap: wrap;
                                            flex-shrink: 1;
                                        }
                                    }
                                }

                                .projectName {
                                    width: 169px;
                                    display: inline-block;
                                    font-size: 12px;
                                    transform-origin: left;
                                    color: #fff;
                                    z-index: 1;
                                    display: flex;
                                    justify-content: center;
                                    align-items: center;

                                    .point {
                                        content: "";
                                        display: inline-block;
                                        width: 2px;
                                        height: 2px;
                                        border-radius: 50%;
                                        background-color: #fff;

                                    }

                                    .projectName_content {
                                        margin: 0 6px;
                                    }
                                }
                            }



                            .qr2 {
                                position: absolute;
                                right: 59px;
                                top: 54px;
                                width: 199px;

                            }
                        }

                        .btn {
                            position: absolute;
                            bottom: 40px;
                            right: 77px;
                        }
                    }

                }

            }
        }


    }
}
</style>